package com.liang.reflect;

public class ReflectDemo {
    public static void main(String[] args) throws ClassNotFoundException {
        //获取类对象的三种方式

        //Class。formate
        Class aClass1 = Class.forName("com.liang.reflect.Student");

        //类的class属性
        Class aClass2 = Student.class;

        //对象的getclass方法
        Student stu = new Student();
        Class aClass3 = stu.getClass();

        System.out.println(aClass1);
        System.out.println(aClass2);
        System.out.println(aClass3);


        System.out.println(aClass1==aClass2);
        System.out.println(aClass3==aClass2);

    }
}
